
class BLAZE: public SPELL
{
public:
	BLAZE()
	{
		SetName("Blaze");
		SetPrice(10000);
		SetManaCost(50);
		SetMagnitude(1);
		SetSpellType(ST_BLAZE);
	}

	BLAZE(BLAZE* newspell)
	{
		SetName(newspell->GetName());
		SetPrice(newspell->GetPrice());
		SetManaCost(newspell->GetManaCost());
		SetMagnitude(newspell->GetMagnitude());
		SetSpellType(newspell->GetSpellType());
	}

	void Cast(ENTITY* elist,int ecount)
	{
		cout << "You begin to focus your energy..\n";

		int amount = 0;

		while (true)
		{
			cout << "How much energy would you like to focus? (0 - 1000)\n";
			cout << ">";

			cin >> amount;
			cin.clear();
			cin.ignore(INT_MAX,'\n');

			if (amount >= 0 && amount <= 1000)
				break;

			cout << "Invalid choice.\n\n";
		}

		int randomnumber = 0;
		bool candamage = false;

		if ( amount <= 50 )
		{
			//go ahead and do the damage
			candamage = true;
		}
		else if ( amount > 50 && amount <= 200)
		{
			//50 50 chance
			randomnumber = rand()%2;

			if (randomnumber == 1)
				candamage = true;
		}
		else if (amount > 200 && amount <= 600)
		{
			// 1 in 5 chance

			randomnumber = rand()%5;

			if (randomnumber == 4)
				candamage = true;
		}
		else
		{
			//rare chance
			// 1 in 10

			randomnumber = rand()%10;

			if (randomnumber == 9)
				candamage = true;
		}


		if (candamage)
		{
			//output generic message
			cout << "In a giant fire blaze, the " << elist->GetName() << " is damaged for " << amount << " health.\n";
			elist->LoseHealth(amount);
		}
		else
		{
			cout << "Your spell fizzles.\n";
		}
	}
};